package com.spark.lola.feign;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.spark.lola.statistics.entity.StatisticsDestination;
import com.spark.lola.statistics.entity.StatisticsPurchase;
import com.spark.lola.statistics.entity.StatisticsSalesman;
import com.spark.lola.statistics.entity.StatisticsSupplier;
import com.spark.lola.statistics.vo.PurchaseStatisticsVo;
import com.spark.lola.statistics.vo.PurchaseWorkVo;
import com.spark.lola.support.common.entity.ShiroUser;
import com.spark.lola.support.mybatis.entity.QueryParam;
import com.spark.lola.support.mybatis.entity.ShiroQueryParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 采购统计
 * @Author: DengYeJun
 * @Date: 2020/5/19 18:21
 */
@FeignClient(name="BI-MANAGE",path = "bi/rpc/pur/")
public interface PurReportFeignService {
    /**
     * 获取指定期间员工统计
     * @param shiroUser
     * @param start
     * @param end
     * @return
     */
    @RequestMapping(value = "/statistics/employee/{start}/{end}",method = RequestMethod.POST)
    PurchaseStatisticsVo employeeStatistics(@RequestBody ShiroUser shiroUser,@PathVariable String start,@PathVariable String end);

    /**
     * 获取供应商指定期间统计
     * @param supplierId 供应商Id
     * @param start
     * @param end
     * @return
     */
    @RequestMapping(value = "/statistics/supplier",method = RequestMethod.POST)
    PurchaseStatisticsVo supplierStatistics(@RequestParam("supplierId") Long supplierId,@RequestParam("start") String start,@RequestParam("end") String end);

    /**
     * 获取纸厂指定期间统计
     * @param destinationId
     * @param start
     * @param end
     * @return
     */
    @RequestMapping(value = "/statistics/destination",method = RequestMethod.POST)
    StatisticsDestination destinationStatistics(@RequestParam("destinationId") Long destinationId,@RequestParam("start") String start,@RequestParam("end") String end);


    /**
     * 员工待处理业务
     * @param shiroUser
     * @return
     */
    @RequestMapping(value = "/work/employee",method = RequestMethod.POST)
    PurchaseWorkVo employeeWork(ShiroUser shiroUser);

    /**
     * 供应商待处理业务
     * @param supplierId
     * @return
     */
    @RequestMapping(value = "/work/supplier",method = RequestMethod.POST)
    PurchaseWorkVo supplierWork(Long supplierId);

    /**
     * 获取采购日报表
     */
    @RequestMapping(value = "/report/purchase/day",method = RequestMethod.POST)
    Page<StatisticsPurchase> dayPurchaseReport(@RequestBody ShiroQueryParam<StatisticsPurchase> shiroQueryParam);

    /**
     * 获取采购月报表
     */
    @RequestMapping(value = "/report/purchase/month",method = RequestMethod.POST)
    Page<StatisticsPurchase> monthPurchaseReport(@RequestBody ShiroQueryParam<StatisticsPurchase> shiroQueryParam);

    /**
     * 获取采购年报表
     */
    @RequestMapping(value = "/report/purchase/year",method = RequestMethod.POST)
    Page<StatisticsPurchase> yearPurchaseReport(@RequestBody ShiroQueryParam<StatisticsPurchase> shiroQueryParam);

    /**
     * 获取业务员日报表
     */
    @RequestMapping(value = "/report/salesman/day",method = RequestMethod.POST)
    Page<StatisticsSalesman> daySalesmanReport(@RequestBody ShiroQueryParam<StatisticsSalesman> shiroQueryParam);

    /**
     * 获取业务员月报表
     */
    @RequestMapping(value = "/report/salesman/month",method = RequestMethod.POST)
    Page<StatisticsSalesman> monthSalesmanReport(@RequestBody ShiroQueryParam<StatisticsSalesman> shiroQueryParam);

    /**
     * 获取业务员年报表
     */
    @RequestMapping(value = "/report/salesman/year",method = RequestMethod.POST)
    Page<StatisticsSalesman> yearSalesmanReport(@RequestBody ShiroQueryParam<StatisticsSalesman> shiroQueryParam);

    /**
     * 获取供应商日报表
     */
    @RequestMapping(value = "/report/supplier/day/{supplierId}",method = RequestMethod.POST)
    Page<StatisticsSupplier> daySupplierReport(@RequestBody QueryParam<StatisticsSupplier> queryBean,
                                  @PathVariable Long supplierId);

    /**
     * 获取供应商月报表
     */
    @RequestMapping(value = "/report/supplier/month/{supplierId}",method = RequestMethod.POST)
    Page<StatisticsSupplier> monthSupplierReport(@RequestBody QueryParam<StatisticsSupplier> queryBean,
                                                  @PathVariable Long supplierId);



    /**
     * 获取供应商年报表
     */
    @RequestMapping(value = "/report/supplier/year/{supplierId}",method = RequestMethod.POST)
    Page<StatisticsSupplier> yearSupplierReport(@RequestBody QueryParam<StatisticsSupplier> queryBean,
                                                @PathVariable Long supplierId);

    /**
     * 获取纸厂日报表
     */
    @RequestMapping(value = "/report/supplier/sum",method = RequestMethod.POST)
    Page<StatisticsDestination> sumDestinationReport(@RequestBody QueryParam<StatisticsDestination> queryBean);

    /**
     * 获取纸厂日报表
     */
    @RequestMapping(value = "/report/destination/day/{destinationId}",method = RequestMethod.POST)
    Page<StatisticsDestination> dayDestinationReport(@RequestBody QueryParam<StatisticsDestination> queryBean,
                                                     @PathVariable Long destinationId);

    /**
     * 获取纸厂月报表
     */
    @RequestMapping(value = "/report/destination/month/{destinationId}",method = RequestMethod.POST)
    Page<StatisticsDestination> monthDestinationReport(@RequestBody QueryParam<StatisticsDestination> queryBean,
                                                 @PathVariable Long destinationId);

    /**
     * 获取纸厂年报表
     */
    @RequestMapping(value = "/report/destination/year/{destinationId}",method = RequestMethod.POST)
    Page<StatisticsDestination> yearDestinationReport(@RequestBody QueryParam<StatisticsDestination> queryBean,
                                                @PathVariable Long destinationId);
}
